Tharun P Karun's Blog

How to know & block a DDoS Attack to your server

Today, In this tutorial I”d like to share you a tutorial in which you can check if your server is having a DDoS on a Linux based server or not, If so, How can we prevent it?

There are many ways to check if your server is being DDoS or not,

Procedure

netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

/sbin/iptables -I INPUT -s 1.1.1.1 -p tcp -j DROP
/sbin/iptables -I INPUT -s 1.1.1.1 -p udp -j DROP